import type { Shape } from './shapes/Shape';

export type DrawingMode = 'select' | 'draw' | 'rectangle' | 'circle' | 'path' | 'cube';

export interface AnchorPoint {
  x: number;
  y: number;
  type: string;
}

export interface CanvasState {
  mode: DrawingMode;
  isDragging: boolean;
  isDrawing: boolean;
  isSelecting: boolean;
  isMovingShape: boolean;
  isResizing: boolean;
  isResizingShape: boolean;
  dragStartX: number;
  dragStartY: number;
  offsetX: number;
  offsetY: number;
  scale: number;
  lastX: number;
  lastY: number;
  originX: number;
  originY: number;
  currentShape: Shape | null;
  shapes: Shape[];
  selectedShape: Shape | null;
  strokeColor: string;
  strokeWidth: number;
  activeAnchor: AnchorPoint | null;
  resizingAnchor?: AnchorPoint | null;
}

export interface StateManagerOptions {
  initialState?: Partial<CanvasState>;
  onStateChange?: (state: CanvasState) => void;
}
